﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using Niazi.CRM.Business;

namespace Niazi.CRM.Web
{
    public partial class PrintTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnPrint_Click(object sender, EventArgs e)
        {
            List<string> names = new List<string>();
            names.Add("OrderId");

            List<object> values = new List<object>();
            values.Add(txtOrderId.Text);

            string connInfo = ConfigurationManager.ConnectionStrings["NiaziMembership"].ToString();
            CrystalReportManager manager = new CrystalReportManager(txtReportName.Text, names, values);
            manager.Init(connInfo);
            manager.PrintToPrinter(ConfigurationManager.AppSettings["PrinterName"]);
            manager.Dispose();
        }
    }
}